document.addEventListener("deviceready", function(){
    alert('deviceready:' + device.platform);

    var parentElement = document.getElementById('deviceready');
    var listeningElement = parentElement.querySelector('.listening');
    var receivedElement = parentElement.querySelector('.received');

    listeningElement.setAttribute('style', 'display:none;');
    receivedElement.setAttribute('style', 'display:block;');

    let inCordova = typeof(device) !== 'undefined';

    let divcordova = document.createElement('div');
    divcordova.innerText = inCordova ? 'cordova support: ' + 'device.platform='+device.platform : 'whithout cordova';
    document.body.appendChild(divcordova);
}, false);